package com.atguigu07._abstract.exer2;

import java.util.Scanner;

/**
 * ClassName: PayrollSystem
 * Package: com.atguigu07._abstract.exer2
 * Description:
 *
 * @Author ZY
 * @Create 15:59
 * @Version 1.0
 */
public class PayrollSystem {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        Employee[] emps = new Employee[2];

        emps[0] = new SalariedEmployee("张三", 1001,
                new MyDate(1992, 12, 2), 18000);

        emps[1] = new HourlyEmployee("李四", 1002,
                new MyDate(1997, 1, 12), 240,100);

        System.out.println("请输入当前的月份: ");
        int month = input.nextInt();

        for (int i = 0; i < emps.length; i++) {
            System.out.println(emps[i].toString());
            System.out.println("月工资：" + emps[i].earnings());

            if(month == emps[i].getBirthday().getMonth()){
                System.out.println("生日当月，奖励100元");
            }
        }

        input.close();
    }
}
